﻿using System.Web;
using System.Web.Mvc;
using System.Web.Routing;

namespace NewsPortal
{
    public class MvcApplication : HttpApplication
    {
        public static void RegisterRoutes(RouteCollection routes)
        {
            routes.MapRoute(
                "Image",
                "images/image/{id}",
                new { controller = "Image", action = "ViewImage",id = UrlParameter.Optional }); 
            routes.MapRoute(
                "Default",
                "{controller}/{action}",
                new {controller="Portal", action = "Run"});
                    }

        protected void Application_Start()
        {
            AreaRegistration.RegisterAllAreas();

            RegisterRoutes(RouteTable.Routes);
        }
    } // Editor/
}